import { defineStore } from "pinia";
import { UserDto } from "@/api/token";


export const useUserStore = defineStore("user-info", {
  state: () => ({
    userInfo: {} as UserDto,
    isAuthenticate: false,
  }),
  actions: {
    addUserInfo(userInfo: UserDto) {
      this.userInfo = userInfo;
      this.isAuthenticate = true;
    },
    removeUserInfo() {
      this.userInfo = {} as UserDto;
      this.isAuthenticate = false;
    },
  },
  persist: true
});
